package com.projectmanagement.model.data;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import com.sun.jmx.snmp.Timestamp;

@Entity
@Table(name = "Project_messages")
public class ProjectMessage implements Serializable {

	private static final long serialVersionUID = -8012948735529757924L;

	@Id
	@Column(name = "id")
	@GeneratedValue
	private long id;

	@Column(name = "project_id", nullable = false)
	private Project project;

	@Column(name="title", nullable = false)
	private String title = "";
	
	@Column(name="text", nullable = false)
	private String text = "";
	
	@Column(name="additional_text", nullable = true)
	private String additionalText = "";
	
	@Column(name="is_important", nullable = false)
	private boolean isImportant = false;
	
	@Column(name="is_private", nullable = false)
	private boolean isPrivate = true;
	
	@Column(name="comments_enabled", nullable = false)
	private boolean commentsEnabled = false;
	
	@Column(name="anonymous_comments_enabled", nullable = false)
	private boolean anonymousCommentsEnabled = false;
	
	@Column(name="created_on", nullable = false)
	private Timestamp createdOn = new Timestamp(0);
	
	@Column(name="created_by_id", nullable = true)
	private User createdBy;
	
	@Column(name="updated_on", nullable = false)
	private Timestamp updatedOn = new Timestamp(0);
	
	@Column(name="updated_by_id", nullable = true)
	private User updatedBy;
	
	public ProjectMessage() {
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public Project getProject() {
		return project;
	}

	public void setProject(Project project) {
		this.project = project;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	public String getAdditionalText() {
		return additionalText;
	}

	public void setAdditionalText(String additionalText) {
		this.additionalText = additionalText;
	}

	public boolean isImportant() {
		return isImportant;
	}

	public void setImportant(boolean isImportant) {
		this.isImportant = isImportant;
	}

	public boolean isPrivate() {
		return isPrivate;
	}

	public void setPrivate(boolean isPrivate) {
		this.isPrivate = isPrivate;
	}

	public boolean isCommentsEnabled() {
		return commentsEnabled;
	}

	public void setCommentsEnabled(boolean commentsEnabled) {
		this.commentsEnabled = commentsEnabled;
	}

	public boolean isAnonymousCommentsEnabled() {
		return anonymousCommentsEnabled;
	}

	public void setAnonymousCommentsEnabled(boolean anonymousCommentsEnabled) {
		this.anonymousCommentsEnabled = anonymousCommentsEnabled;
	}

	public Timestamp getCreatedOn() {
		return createdOn;
	}

	public void setCreatedOn(Timestamp createdOn) {
		this.createdOn = createdOn;
	}

	public User getCreatedBy() {
		return createdBy;
	}

	public void setCreatedBy(User createdBy) {
		this.createdBy = createdBy;
	}

	public Timestamp getUpdatedOn() {
		return updatedOn;
	}

	public void setUpdatedOn(Timestamp updatedOn) {
		this.updatedOn = updatedOn;
	}

	public User getUpdatedBy() {
		return updatedBy;
	}

	public void setUpdatedBy(User updatedBy) {
		this.updatedBy = updatedBy;
	}
	
}
